import request from '@/utils/request';

// 获取部门数据的方法
export function getDepartMents() {
  return request({
    method: 'get',
    url: '/company/department',
  });
}

/**
 *
 * @param {*} id
 * @returns
 */
export function delDepartMents(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`,
  });
}

/**
 *  新增部门接口
 *
 * ****/
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data: data,
  });
}

/**
 *  获取员工的简单列表
 * **/
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple',
  });
}

/** *
 * 获取部门详情
 * ***/
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`,
  });
}

/**
 * 编辑部门
 *
 * ***/
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data,
  });
}
